package jnpf.engine.custom.event.logger;

import com.fasterxml.jackson.databind.ObjectMapper;
import jnpf.engine.custom.event.flusher.ElasticSearchFlusher;
import jnpf.engine.custom.event.handler.EntityUpdatedEventHandler;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEventType;
import org.flowable.common.engine.impl.runtime.Clock;
import org.flowable.engine.impl.event.logger.EventFlusher;
import org.flowable.engine.impl.event.logger.EventLogger;

/**
 * @author LoveMyOrange
 * @create 2022-02-02 11:45
 */
public class ElasticSearchEventLogger extends EventLogger {
    @Override
    protected EventFlusher createEventFlusher() {
        ElasticSearchFlusher elasticSearchFlusher = new ElasticSearchFlusher();
        return elasticSearchFlusher;
    }

    public ElasticSearchEventLogger(Clock clock, ObjectMapper objectMapper) {
        super(clock, objectMapper);
    }

    @Override
    protected void initializeDefaultHandlers() {
        super.initializeDefaultHandlers();
        addEventHandler(FlowableEngineEventType.ENTITY_UPDATED, EntityUpdatedEventHandler.class);
    }
}







